home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / copyimgb / cidemo.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-10-17  |  5.2 KB  |  117 lines

  1. VERSION 5.00
  2. Object = "{9F3DA521-3D24-11D2-BB47-0060978DAE40}#1.1#0"; "CIMAGE.DLL"
  3. Begin VB.Form Form1 
  4.    Caption         =   "CopyImage Demo"
  5.    ClientHeight    =   2610
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   4110
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   174
  11.    ScaleMode       =   3  'Pixel
  12.    ScaleWidth      =   274
  13.    StartUpPosition =   2  'CenterScreen
  14.    Begin VB.CommandButton cmdCopyPicture 
  15.       Caption         =   "CopyPicture Method"
  16.       Height          =   495
  17.       Left            =   1920
  18.       TabIndex        =   2
  19.       Top             =   1800
  20.       Width           =   1935
  21.    End
  22.    Begin VB.PictureBox Picture1 
  23.       AutoSize        =   -1  'True
  24.       Height          =   1305
  25.       Left            =   240
  26.       Picture         =   "cidemo.frx":0000
  27.       ScaleHeight     =   1245
  28.       ScaleWidth      =   3000
  29.       TabIndex        =   1
  30.       Top             =   240
  31.       Width           =   3060
  32.    End
  33.    Begin VB.CommandButton cmdCopyFile 
  34.       Caption         =   "CopyFile Method"
  35.       Height          =   495
  36.       Left            =   240
  37.       TabIndex        =   0
  38.       Top             =   1800
  39.       Width           =   1455
  40.    End
  41.    Begin CIMAGELibCtl.CopyImag CopyImag1 
  42.       Left            =   3600
  43.       OleObjectBlob   =   "cidemo.frx":451A
  44.       Top             =   840
  45.    End
  46. Attribute VB_Name = "Form1"
  47. Attribute VB_GlobalNameSpace = False
  48. Attribute VB_Creatable = False
  49. Attribute VB_PredeclaredId = True
  50. Attribute VB_Exposed = False
  51. Option Explicit
  52. '  CopyImage is a light weight COM-based DLL control that can convert
  53. '  graphic images to image files (wmf/emf/bmp to gif/bmp). Graphic images
  54. '  can be resized during the conversion. This allows image resizing
  55. '  without distortion when converting Metafiles. CopyImage has a file
  56. '  to file interface and a binary to file interface. From VB you can
  57. '  create a gif copy of any control's Picture property using the binary
  58. '  interface. With CopyImage you can create WEB documents on the fly and
  59. '  create a Gif file that is larger than the screen.
  60. '  This demo program is a simple example of how to use CopyImage. The program
  61. '  will show you how to use the CopyFile and CopyPicture methods. Note, the
  62. '  PictureBox's Picture property can be a *.bmp, *.wmf or a *.emf file.
  63. '  You can use Microsoft Word to view metafiles and the gif file results.
  64. '  If you are familiar with our MetaGif product, CopyImage is COM replacement
  65. '  for MetaGif. MetaGif is a standard DLL library not a COM object. Since
  66. '  CopyImage is a COM object or ActiveX control, CopyImage has the advantage
  67. '  of being used in more applications or containers such as VB, Internet
  68. '  Explorer 4.0 and IIS Active Server Pages. If you want to purchase
  69. '  CopyImage please see our web site listed below for order information.
  70. '  The author of this program accepts no responsibility for damages
  71. '  resulting from the use of this product and makes no warranty or
  72. '  representation, either express or implied, including but not limited
  73. '  to, any implied warranty of merchantability or fitness for a particular
  74. '  purpose. This software is provided "AS IS", and you, its user, assume
  75. '  all risks when using it.
  76. '  Author:
  77. '     David E. Suffield
  78. '     Eckler Software
  79. '     dsuffiel@worldaccessnet.com
  80. '     dsuffiel@hotmail.com
  81. '     www.worldaccessnet.com/~dsuffiel
  82. Private Sub cmdCopyFile_Click()
  83.    Dim ep As String
  84.    Dim i As Integer
  85.    Me.MousePointer = vbHourglass
  86.    ep = IIf(Right$(App.Path, 1) <> "\", App.Path + "\", App.Path)
  87.    'Create gif copies.
  88.    CopyImag1.Type = 1
  89.    Call CopyImag1.CopyFile(ep + "coins.wmf", ep + "coins100.gif", 100, 100)
  90.    Call CopyImag1.CopyFile(ep + "bird.emf", ep + "bird50.gif", 50, 50)
  91.    Call CopyImag1.CopyFile(ep + "eckler.bmp", ep + "eckler100.gif", 100, 100)
  92.    'Create bmp copies.
  93.    CopyImag1.Type = 2
  94.    Call CopyImag1.CopyFile(ep + "coins.wmf", ep + "coins75.bmp", 75, 75)
  95.    Call CopyImag1.CopyFile(ep + "bird.emf", ep + "bird40.bmp", 40, 40)
  96.    Call CopyImag1.CopyFile(ep + "eckler.bmp", ep + "eckler130.bmp", 130, 130)
  97.    Me.MousePointer = vbDefault
  98. End Sub
  99. Private Sub cmdCopyPicture_Click()
  100.    Dim ep As String
  101.    Me.MousePointer = vbHourglass
  102.    ep = IIf(Right$(App.Path, 1) <> "\", App.Path + "\", App.Path)
  103.    'Create gif copies.
  104.    CopyImag1.Type = 1
  105.    Set Picture1.Picture = LoadPicture(ep + "eckler.bmp")
  106.    Call CopyImag1.CopyPicture(Picture1.Picture, ep + "gif100.gif", Picture1.Width, Picture1.Height)
  107.    Set Picture1.Picture = LoadPicture(ep + "coins.wmf")
  108.    Call CopyImag1.CopyPicture(Picture1.Picture, ep + "gif60.gif", Picture1.Width * 0.6, Picture1.Height * 0.6)
  109.    Set Picture1.Picture = LoadPicture(ep + "bird.emf")
  110.    Call CopyImag1.CopyPicture(Picture1.Picture, ep + "gif40.gif", Picture1.Width * 0.4, Picture1.Height * 0.4)
  111.    'Create bmp copies.
  112.    CopyImag1.Type = 2
  113.    Set Picture1.Picture = LoadPicture(ep + "eckler.bmp")
  114.    Call CopyImag1.CopyPicture(Picture1.Picture, ep + "bmp120.bmp", Picture1.Width * 1.2, Picture1.Height * 1.2)
  115.    Me.MousePointer = vbDefault
  116. End Sub
  117.